package com.sport.facilities.booking.system;

import com.sport.facilities.booking.system.facebook.MainFragment;
import com.sport.facilities.booking.system.model.Booking;
import com.sport.facilities.booking.system.model.BookingRequestModel;
import com.sport.facilities.booking.system.ui.DialogHelper;

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;

public class FacebookActivity extends FragmentActivity {

	private static final String TAG = "FacebookActivity";
	private MainFragment mainFragment;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.facebook);
		getIntent().getSerializableExtra("bookObj");

		// Button shareButton = (Button) findViewById(R.id.shareButton);

		final Booking bkdetail = (Booking) getIntent().getSerializableExtra(
				"bookObj");
		//MainFragment facebook = new MainFragment();
		//facebook.setBookDetail();
		//MainFragment.newInstance(bkdetail);
		
		if (savedInstanceState == null) {
			// Add the fragment on initial activity setup
			
		    // Instantiate a new fragment.   
			
			MainFragment newFragment = MainFragment.newInstance(bkdetail);   
			
			
			// Add the fragment to the activity, pushing this transaction    // on to the back stack.   
			

			//mainFragment = new MainFragment();
			getSupportFragmentManager().beginTransaction()
					.add(android.R.id.content, newFragment).commit();
		} else {
			// Or set the fragment from restored state info
			mainFragment = (MainFragment) getSupportFragmentManager()
					.findFragmentById(android.R.id.content);
		}
	}

	
	
	
}